import 'package:get/get.dart';
import 'package:getx_scaffold/getx_scaffold.dart';
import 'package:azring/core/controllers/auth_controller.dart';

import 'login_state.dart';

class LoginLogic extends GetxController {
  final LoginState state = LoginState();

  @override
  void onInit() {
    super.onInit();
  }

  Future<void> requestData(
      {required String username,
      String? password,
      String? uuid,
      String? code,
      String loginType = '1'}) async {
    if (code?.isNotEmpty == true) {
      if (username.isEmail == true) {
        loginType = '2';
      } else {
        loginType = '3';
      }
    }
    AuthController.to.login(
        username: username,
        password: password,
        uuid: uuid,
        code: code,
        loginType: loginType);
  }
}
